import { lazy } from 'react'
/* -------------------------------------------------------- Declare -- */
const { $fn,  $lazy } = window
/* -------------------------------------------------------- Async Component -- */
const SubmitForm = $lazy.hook(()=>import('#cpt/form/submit-form'))
const Page = lazy(()=>import('#tp/content/page-content'))
/* -------------------------------------------------------- Page Component -- */
const Component = () => {
	const pageConfig = {
		title: '修改密码',
	}
	const { username } = $fn.getUser()
	const config = {
		labelWidth: 's7',
		api: 'user/mod_pwd',
		way: 'put',
		paddingClass: 'pt10 pr10',
		data:[
			{ label:'用户名', 	name:'username',	half:1, disabled: 1, value: username},
			{ label: '原密码',	name: 'old_pwd', 	type:'password', r:1, half:1, br:1 },
			{ label: '新密码',	name: 'password', 		type:'password', r:1, half:1, br:1},
			{ label: '确认密码',	name: 'confirm_pwd', 	type:'password', r:1, half:1, br:1},
		],
		onOk: ({ formRef }) => formRef.reset()
	}
	return (
		<Page {...pageConfig}><SubmitForm {...config}/></Page>
	)
}
export default Component